package com.learnpilot.datechange.utils;

import java.io.StringReader;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.xml.sax.InputSource;

public class XmlUtil {

	DocumentBuilderFactory factory;
	DocumentBuilder builder;
    Document document ;

	public Document getXMLFromString(String xmlString){
		factory = DocumentBuilderFactory.newInstance();
	    try
	    {
	        builder = factory.newDocumentBuilder();
	        document = builder.parse(new InputSource(new StringReader( xmlString)));
	    } catch (Exception e) {
	        e.printStackTrace();
	    }
		return document;
	}
}
